package com.example.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.common.Result;
import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Component
@Service
public class UserService {

    @Resource
    UserMapper userMapper;
    public Result<?> insert(@RequestBody User user){
        userMapper.insert(user);

        System.out.println("插入数据成功");
        return Result.success();
    }


    public Result<?> updateById(@RequestBody User user){
        userMapper.updateById(user);

        System.out.println("更新数据成功");
        return Result.success();
    }

}
